package com.baox.agridata.synchronous.controller;

import com.baox.agridata.synchronous.entity.*;
import com.baox.agridata.synchronous.result.Result;
import com.baox.agridata.synchronous.service.AsyncXDRBaseInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 接收成都发往四川数据的Controller(接收相对人基础数据的)
 */
@RestController
@Slf4j
@RequestMapping("/receive")
public class ReceiveChengDuBaseInfoDataController {


    @Autowired
    private AsyncXDRBaseInfoService asyncXDRBaseInfoService;


    @RequestMapping(value = "/ChengduTXDRCar", method = RequestMethod.POST)
    public Result receiveChengDuTXDRCar(@RequestBody List<TXDRCarEntity> l_list) {   //接收车辆数据
        return asyncXDRBaseInfoService.dealReceiveListXDRCarData(l_list);
    }


    @RequestMapping(value = "/ChengduTXDRSlaughterHouse", method = RequestMethod.POST)
    public Result receiveChengDuTXDRSlaughterHouse(@RequestBody List<TXDRSlaughterHouseEntity> l_list) {   //接收屠宰场
        return asyncXDRBaseInfoService.dealReceiveListXDRSlaughterHouseData(l_list);
    }


    @RequestMapping(value = "/ChengduXDRTrafficking", method = RequestMethod.POST)
    public Result receiveChengDuTXDRTrafficking(@RequestBody List<TXDRTraffickingEntity> l_list) {   //接受贩运户
        return asyncXDRBaseInfoService.dealReceiveListXDRTraffickingData(l_list);
    }

    @RequestMapping(value = "/ChengduXDRFarm", method = RequestMethod.POST)
    public Result receiveChengDuXDRFarm(@RequestBody List<TXDRFarmEntity> l_list) {   //接受养殖户
        return asyncXDRBaseInfoService.dealReceiveListXDRFarmData(l_list);
    }


    @RequestMapping(value = "/ChengduXDRHatchery", method = RequestMethod.POST)
    public Result receiveChengDuTXDRHatchery(@RequestBody List<TXDRHatcheryEntity> l_list) {   //接收孵化场
        asyncXDRBaseInfoService.dealReceiveListXDRHatcheryData(l_list);
        return Result.ok();
    }






}
